using UnityEngine;
using System.Collections;

[RequireComponent(typeof(UICheckbox))]
public class RestoreOrigin : MonoBehaviour {
	public Transform target;
	
	Transform mTrans;
	UITweener tweener;
	
	UICheckbox checkBox;

	// Use this for initialization
	void Start () {
		if(target != null) mTrans = target;
		else mTrans = transform;
		
		checkBox = GetComponent<UICheckbox>();
		tweener = target.GetComponent<UITweener>();
	}
	
	void Update(){
		if(!checkBox.isChecked){
			tweener.Play(false);
		}
	}
}
